<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>MARC-JSON Draft 2010-03-11 | OCLC Developer Network</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/developer/sites/all/themes/devnet/favicon.ico" type="image/x-icon" />
	
	<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/reset-fonts-grids/reset-fonts-grids.css">
	<link type="text/css" rel="stylesheet" media="all" href="/developer/sites/default/files/css/css_44492b29d7764d64592932ffd59fbf49.css" />
<link type="text/css" rel="stylesheet" media="print" href="/developer/sites/default/files/css/css_014e3a41d59a51dec8d2e823179df4f7.css" />
<!--[if IE]>
<link type="text/css" rel="stylesheet" media="all" href="/developer/sites/all/themes/zen/zen/ie.css?N" />
<![endif]-->
<!--[if IE7]>
<link type="text/css" rel="stylesheet" media="all" href="/developer/sites/all/themes/devnet/ie.css?N" />
<![endif]-->
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="/developer/sites/default/files/js/js_0aab5d796376a05e4924dd089ab4af58.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/developer/", "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." }, "lightbox2": { "rtl": 0, "file_path": "/developer/(\\w\\w/)sites/default/files", "default_image": "/developer/sites/all/modules/lightbox2/images/brokenimage.jpg", "border_size": 10, "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": "0.8", "overlay_color": "000", "disable_close_click": true, "resize_sequence": 0, "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 600, "use_alt_layout": false, "disable_resize": false, "disable_zoom": false, "force_show_nav": false, "show_caption": true, "loop_items": false, "node_link_text": "View Image Details", "node_link_target": false, "image_count": "Image !current of !total", "video_count": "Video !current of !total", "page_count": "Page !current of !total", "lite_press_x_close": "press \x3ca href=\"#\" onclick=\"hideLightbox(); return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e to close", "download_link_text": "", "enable_login": false, "enable_contact": false, "keys_close": "c x 27", "keys_previous": "p 37", "keys_next": "n 39", "keys_zoom": "z", "keys_play_pause": "32", "display_image_size": "original", "image_node_sizes": "()", "trigger_lightbox_classes": "", "trigger_lightbox_group_classes": "", "trigger_slideshow_classes": "", "trigger_lightframe_classes": "", "trigger_lightframe_group_classes": "", "custom_class_handler": "lightbox_ungrouped", "custom_trigger_classes": "img.news_lb", "disable_for_gallery_lists": 1, "disable_for_acidfree_gallery_lists": true, "enable_acidfree_videos": true, "slideshow_interval": 5000, "slideshow_automatic_start": true, "slideshow_automatic_exit": true, "show_play_pause": true, "pause_on_next_click": false, "pause_on_previous_click": true, "loop_slides": false, "iframe_width": 600, "iframe_height": 400, "iframe_border": 1, "enable_video": false }, "og": { "group_context": { "nid": "29", "title": " MARC-JSON Format Specification ", "type": "group" } } });
//--><!]]>
</script>
	<script type="text/javascript">
		SyntaxHighlighter.config.clipboardSwf = '/devnet/sites/all/themes/devnet/syntax/js/clipboard.swf';
		SyntaxHighlighter.all()
</script>
<!--  SiteCatalyst header: put this at/near the end of your <head> section --><script language="JavaScript" src="//www.oclc.org/common/javascript/s_code.js"></script>
</head>
<body>
	<div id="doc2">
		<div id="hd">
			<a href="/developer/" title="Home"><img src="/developer/sites/all/themes/devnet/logo.png" alt="OCLC Developer Network" width="307" height="45"></a>
							  <div id="block-menu-menu-account-menu" class="block block-menu region-odd even region-count-1 count-4"><div class="block-inner">

  
  <div class="content">
    <ul class="menu"><li class="leaf first"><a href="/developer/user/login?destination=node%2F30" title=""><span class="tab">Login</span></a></li>
<li class="leaf last"><a href="/developer/user/register" title=""><span class="tab">Register</span></a></li>
</ul>  </div>

  
</div></div> <!-- /block-inner, /block -->
										<div id="search-box">
				<form action="/developer/content/marc-json-draft-2010-03-11"  accept-charset="UTF-8" method="post" id="search-theme-form">
<div><div id="search" class="container-inline">
  <div class="form-item" id="edit-search-theme-form-1-wrapper">
 <label for="edit-search-theme-form-1">Search this site: </label>
 <input type="text" maxlength="128" name="search_theme_form" id="edit-search-theme-form-1" size="15" value="" title="Enter the terms you wish to search for." class="form-text" />
</div>
<input type="submit" name="op" id="edit-submit" value="Search"  class="form-submit" />
<input type="hidden" name="form_build_id" id="form-74398fdd3421eba7213e5f3107042f91" value="form-74398fdd3421eba7213e5f3107042f91"  />
<input type="hidden" name="form_id" id="edit-search-theme-form" value="search_theme_form"  />
</div>

</div></form>
				</div> <!-- /#search-box -->
			
          			
			<div id="navigation">
              <ul class="links"><li class="menu-262 first"><a href="/developer/" title="">Home</a></li>
<li class="menu-2562"><a href="/developer/platform" title="">Platform</a></li>
<li class="menu-741"><a href="/developer/webservices">Web Services</a></li>
<li class="menu-656"><a href="/developer/applications" title="">Applications</a></li>
<li class="menu-2563"><a href="/developer/code" title="">Code</a></li>
<li class="menu-264"><a href="/developer/events" title="">Events</a></li>
<li class="menu-1088"><a href="/developer/groups" title="">Groups</a></li>
<li class="menu-1673 last"><a href="/developer/news" title="">News</a></li>
</ul>			</div>
		  	
		</div>
		
	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">

				<div id="breadcrumbs" class="yui-g">
					<div class="breadcrumb"><a href="/developer/">Home</a> › <a href="/developer/groups">Groups</a> › <a href="/developer/groups/marc-json-format-specification"> MARC-JSON Format Specification </a> › </div>				</div>
				<div id="int-info" class="yui-g">
								<h1 class="title">MARC-JSON Draft 2010-03-11</h1>
          											
																</div>
				<div class="yui-g">
					<div id="node-30" class="node clear-block">



  <div class="meta">
  
    </div>

  <div class="content">
    <p><strong>This version:</strong> Draft 2010-03-11<br />
<strong>Author:</strong> Andrew Houghton, OCLC Research<br />
<strong>Date issued:</strong> 2010-03-11<br />
<strong>Document Status</strong>: Draft<br />
<strong>License:</strong> Creative Commons Attribution-Share United States license.<a name="Abstract"></a>Abstract<br />
<dl>
<dd>MARC-JSON is a library community data interchange format based on the MARC (ISO 2709) and JavaScript Object Notation (JSON) specifications.</dd>
</dl>
</p><p><a name="Introduction"></a>Introduction<br />
<dl>
<dd>The MARC-JSON format specification is the product of discussions on the <a class="external text" href="https://listserv.nd.edu/cgi-bin/wa?A0=CODE4LIB" rel="nofollow" title="https://listserv.nd.edu/cgi-bin/wa?A0=CODE4LIB">code4lib</a> list about the growing need to serialize MARC as JSON for use with <a class="external text" href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" rel="nofollow" title="http://en.wikipedia.org/wiki/Ajax_(programming)">AJAX</a> scenarios and <a class="external<br />
text" href="http://nosql-database.org/" rel="nofollow" title="http://nosql-database.org/">NoSQL</a> schema-free document-oriented JSON databases, such as <a class="external text" href="http://couchdb.apache.org/" rel="nofollow" title="http://couchdb.apache.org/">CouchDB</a> and <a class="external text" href="http://www.mongodb.org/display/DOCS/Home" rel="nofollow" title="http://www.mongodb.org/display/DOCS/Home">MongoDB</a>. The MARC-JSON format retains the semantics of MARC and allows MARC-JSON to be reserialized into <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#References" title="">MARC, MARC-XML or MarcXchange</a> without loss of semantics or content. This specification describes how to serialize MARC as JSON and presumes a familiarity with MARC.</dd>
</dl>
</p><p><a name="Example"></a>Example<br />
<dl>
<dd>A MARC record is a binary format that contains ASCII control characters and no line breaks which creates a challenge for using in an example. The following sample MARC authority record has been formatted for readability and the ASCII control characters have been replaced by printable representations:</dd>
</dl>
<dl>
<dd>
<ul>
<li>The MARC field terminator (FT), ASCII codepoint 1E (hex), has been replaced with Unicode codepoint U+241E (␞).</li>
<li>The MARC record terminator (RT), ASCII codepoint 1D (hex), has been replaced with Unicode codepoint U+241D (␝).</li>
<li>The MARC subfield delimiter, ASCII codepoint 1F (hex), has been replaced with Unicode codepoint U+241F (␟).</li>
</ul>
</dd>
</dl>
</p><p>00474cz  a2200157n  4500<br />
001 0012 00000<br />
003 0006 00012<br />
005 0017 00018<br />
008 0041 00035<br />
040 0028 00076<br />
016 0023 00104<br />
043 0012 00127<br />
151 0047 00139<br />
688 0032 00186<br />
688 0032 00218<br />
751 0066 00250<br />
␞fst01312614<br />
␞OCoLC<br />
␞20100213044034.6<br />
␞060620nn anznnbabn          || ana     d<br />
␞  ␟aOCoLC␟beng␟cOCoLC␟ffast<br />
␞7 ␟afst01312614␟2OCoLC<br />
␞  ␟an-cn-qu<br />
␞  ␟aQuébec␟zSaint-Laurent (Île-de-Montréal)<br />
␞  ␟aLC (2008) Subject Usage: 13<br />
␞  ␟aWC (2008) Subject Usage: 59<br />
␞ 0␟aSaint-Laurent (Île-de-Montréal, Québec)␟0(DLC)n  80080336<br />
␞␝</p>
<dl>
<dd>For comparision the sample MARC authority record is shown serialized as MARC-XML:</dd>
</dl>
<p>&lt;record xmlns=&quot;http://www.loc.gov/MARC21/slim&quot;&gt;<br />
  &lt;leader&gt;00480cz  a2200157n  4500&lt;/leader&gt;<br />
  &lt;controlfield tag=&quot;001&quot;&gt;fst01312614&lt;/controlfield&gt;<br />
  &lt;controlfield tag=&quot;003&quot;&gt;OCoLC&lt;/controlfield&gt;<br />
  &lt;controlfield tag=&quot;005&quot;&gt;20100213044034.6&lt;/controlfield&gt;<br />
  &lt;controlfield tag=&quot;008&quot;&gt;060620nn anznnbabn          || ana     d&lt;/controlfield&gt;<br />
  &lt;datafield tag=&quot;040&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;OCoLC&lt;/subfield&gt;<br />
    &lt;subfield code=&quot;b&quot;&gt;eng&lt;/subfield&gt;<br />
    &lt;subfield code=&quot;c&quot;&gt;OCoLC&lt;/subfield&gt;<br />
    &lt;subfield code=&quot;f&quot;&gt;fast&lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
  &lt;datafield tag=&quot;016&quot; ind1=&quot;7&quot; ind2=&quot; &quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;fst01312614&lt;/subfield&gt;<br />
    &lt;subfield code=&quot;2&quot;&gt;OCoLC&lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
  &lt;datafield tag=&quot;043&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;n-cn-qu&lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
  &lt;datafield tag=&quot;151&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;Québec&lt;/subfield&gt;<br />
    &lt;subfield code=&quot;z&quot;&gt;Saint-Laurent (Île-de-Montréal)&lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
  &lt;datafield tag=&quot;688&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;LC (2008) Subject Usage: 13&lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
  &lt;datafield tag=&quot;688&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;WC (2008) Subject Usage: 59&lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
  &lt;datafield tag=&quot;751&quot; ind1=&quot; &quot; ind2=&quot;0&quot;&gt;<br />
    &lt;subfield code=&quot;a&quot;&gt;Saint-Laurent (Île-de-Montréal, Québec)&lt;/subfield&gt;<br />
    &lt;subfield code=&quot;0&quot;&gt;(DLC)n  80080336 &lt;/subfield&gt;<br />
  &lt;/datafield&gt;<br />
&lt;/record&gt;</p>
<dl>
<dd>When the above sample MARC authority record is serialized according to this specification it would structurally appear as the following JSON. The JSON below has been formatted for readability with optional whitespace that is allowable under the JSON specification:</dd>
</dl>
<p>{<br />
  leader&nbsp;: &quot;00480cz  a2200157n  4500&quot;,<br />
  controlfield&nbsp;:<br />
  [<br />
    { tag&nbsp;: &quot;001&quot;, data&nbsp;: &quot;fst01312614&quot; },<br />
    { tag&nbsp;: &quot;003&quot;, data&nbsp;: &quot;OCoLC&quot; },<br />
    { tag&nbsp;: &quot;005&quot;, data&nbsp;: &quot;20100213044034.6&quot; },<br />
    { tag&nbsp;: &quot;008&quot;, data&nbsp;: &quot;060620nn anznnbabn          || ana     d&quot; }<br />
  ]<br />
  datafield&nbsp;:<br />
  [<br />
    {<br />
      tag&nbsp;: &quot;040&quot;, ind&nbsp;: &quot;  &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;OCoLC&quot; },<br />
        { code&nbsp;: &quot;b&quot;, data&nbsp;: &quot;eng&quot; },<br />
        { code&nbsp;: &quot;c&quot;, data&nbsp;: &quot;OCoLC&quot; },<br />
        { code&nbsp;: &quot;f&quot;, data&nbsp;: &quot;fast&quot; }<br />
      ]<br />
    },<br />
    {<br />
      tag&nbsp;: &quot;016&quot;, ind&nbsp;: &quot;7 &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;fst01312614&quot; },<br />
        { code&nbsp;: &quot;2&quot;, data&nbsp;: &quot;OCoLC&quot; }<br />
      ]<br />
    },<br />
    {<br />
      tag&nbsp;: &quot;043&quot;, ind&nbsp;: &quot;  &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;n-cn-qu&quot; }<br />
      ]<br />
    },<br />
    {<br />
      tag&nbsp;: &quot;151&quot;, ind&nbsp;: &quot;  &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;Québec&quot; },<br />
        { code&nbsp;: &quot;z&quot;, data&nbsp;: &quot;Saint-Laurent (Île-de-Montréal)&quot; }<br />
      ]<br />
    },<br />
    {<br />
      tag&nbsp;: &quot;688&quot;, ind&nbsp;: &quot;  &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;LC (2008) Subject Usage: 13&quot; }<br />
      ]<br />
    },<br />
    {<br />
      tag&nbsp;: &quot;688&quot;, ind&nbsp;: &quot;  &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;WC (2008) Subject Usage: 59&quot; }<br />
      ]<br />
    },<br />
    {<br />
      tag&nbsp;: &quot;751&quot;, ind&nbsp;: &quot;  &quot;,<br />
      subfield&nbsp;:<br />
      [<br />
        { code&nbsp;: &quot;a&quot;, data&nbsp;: &quot;Saint-Laurent (Île-de-Montréal, Québec)&quot; },<br />
        { code&nbsp;: &quot;0&quot;, data&nbsp;: &quot;(DLC)n  80080336 &quot; }<br />
      ]<br />
    }<br />
  ]<br />
}</p>
<p><a name="Definitions"></a>Definitions<br />
<dl>
<dd>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in IETF <a class="external text" href="http://tools.ietf.org/html/rfc" rel="nofollow" title="http://tools.ietf.org/html/rfc">RFC 2119</a>.</dd>
</dl>
<dl>
<dd>
<dl>
<dt>conforming implementation</dt>
<dd>A conforming implementation is an implementation producing a serialization specified by this specification.</dd>
</dl>
</dd>
</dl>
<dl>
<dd>
<dl>
<dt>consuming application</dt>
<dd>A consuming application is an application consuming a serialization specified by this specification.</dd>
</dl>
</dd>
</dl>
</p><p><a name="Objects"></a>Objects<br />
<dl>
<dd>The MARC-JSON format contains four objects:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#record_Object" title="">record object</a> represents a MARC record.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#controlfield_Object" title="">controlfield object</a> represents a MARC control field.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#datafield_Object" title="">datafield object</a> represents a MARC data field.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#subfield_Object" title="">subfield object</a> represents a MARC subfield.</li>
</ul>
</dd>
</dl>
</p><p><a name="record_Object"></a>record Object<br />
<dl>
<dd>A record object represents a MARC record and contains three properties:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#leader_Property" title="">leader property</a> contains the content from the MARC leader.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#controlfield_Property" title="">controlfield property</a> represents the collection of MARC control fields.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#datafield_Property" title="">datafield property</a> represents the collection of MARC data fields.</li>
</ul>
</dd>
</dl>
</p><p><a name="leader_Property"></a>leader Property<br />
<dl>
<dd>The leader property contains the content from the MARC leader.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;leader&quot;.</li>
<li>The property&#39;s value MUST be a string of exactly 24 characters.</li>
<li>The property&#39;s value SHOULD contain all the characters from the MARC leader.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
<li>A consuming application SHOULD ignore content positions 00-04 of the property&#39;s value.</li>
<li>A consuming application SHOULD ignore content positions 12-16 of the property&#39;s value.</li>
</ul>
</dd>
</dl>
</p><p><a name="controlfield_Property"></a>controlfield Property<br />
<dl>
<dd>The controlfield property represents the collection of MARC control fields.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;controlfield&quot;.</li>
<li>The property&#39;s value MUST be a <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#controlfield_Collection" title="">controlfield collection</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="datafield_Property"></a>datafield Property<br />
<dl>
<dd>The datafield property represents the collection of MARC data fields.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;datafield&quot;.</li>
<li>The property&#39;s value MUST be a <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#datafield_Collection" title="">datafield collection</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="controlfield_Object"></a>controlfield Object<br />
<dl>
<dd>A control field object represents a MARC control field and contains two properties:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#tag_Property" title="">tag property</a> contains the identifier for the MARC control field.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#data_Property" title="">data property</a> contains the content for the MARC control field.</li>
</ul>
</dd>
</dl>
</p><p><a name="tag_Property"></a>tag Property<br />
<dl>
<dd>The tag property contains the identifier for the MARC control field.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;tag&quot;.</li>
<li>The property&#39;s value MUST be a string of exactly 3 characters.</li>
<li>The property&#39;s value SHOULD contain the characters from positions 00-02 of the control field&#39;s MARC directory entry.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
</ul>
</dd>
</dl>
</p><p><a name="data_Property"></a>data Property<br />
<dl>
<dd>The data property contains the content for the MARC control field.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;data&quot;.</li>
<li>The property&#39;s value MUST be a string whose length SHOULD be determined from positions 03-06 of the control field&#39;s MARC directory entry.</li>
<li>The property&#39;s value SHOULD contain the characters starting at the position defined by adding the start record position to the values defined by positions 12-16 in the leader and positions 07-11 in the control field&#39;s directory entry and ending before the next MARC field terminator.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
</ul>
</dd>
</dl>
</p><p><a name="datafield_Object"></a>datafield Object<br />
<dl>
<dd>A data field object represents a MARC data field and contains three properties:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#tag_Property" title="">tag property</a> contains the identifier for the MARC data field.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#ind_Property" title="">ind property</a> contains the indicators for the MARC data field.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#subfield_Property" title="">subfield property</a> represents the collection of MARC subfields for the data field.</li>
</ul>
</dd>
</dl>
</p><p><a name="tag_Property_2"></a>tag Property<br />
<dl>
<dd>The tag property contains the identifier for the MARC data field.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;tag&quot;.</li>
<li>The property&#39;s value MUST be a string of exactly 3 characters.</li>
<li>The property&#39;s value SHOULD contain the characters from position 00-02 of the data field&#39;s MARC directory entry.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
</ul>
</dd>
</dl>
</p><p><a name="ind_Property"></a>ind Property<br />
<dl>
<dd>The ind property contains the indicators for the MARC data field.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;ind&quot;.</li>
<li>The property&#39;s value MUST be a string whose length is defined by position 10 from the MARC leader.</li>
<li>The property&#39;s value SHOULD contain the characters starting at the position defined by adding the start record position to the values defined by positions 12-16 in the leader and positions 07-11 in the control field&#39;s directory entry and continuing for the length defined by position 10 from the MARC leader.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
</ul>
</dd>
</dl>
</p><p><a name="subfield_Property"></a>subfield Property<br />
<dl>
<dd>The subfield property represents the collection of MARC subfields for a data field.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property MUST be named &quot;subfield&quot;.</li>
<li>The property&#39;s value MUST be a <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#subfield_Collection" title="">subfield collection</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="subfield_Object"></a>subfield Object<br />
<dl>
<dd>A subfield object represents a MARC subfield and contains two properties:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#code_Property" title="">code property</a> contains the identifier for the MARC subfield.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#data_Property" title="">data property</a> contains the content for the MARC subfield.</li>
</ul>
</dd>
</dl>
</p><p><a name="code_Property"></a>code Property<br />
<dl>
<dd>The code property contains the identifier for the MARC subfield.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;code&quot;.</li>
<li>The property&#39;s value MUST be a string whose length is defined by position 11 from the MARC leader minus one.</li>
<li>The property&#39;s value SHOULD contain the characters after the subfield&#39;s delimiter for a length defined by position 11 from the MARC leader minus one.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
</ul>
</dd>
</dl>
</p><p><a name="data_Property_2"></a>data Property<br />
<dl>
<dd>The data property contains the content for the MARC subfield.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The property&#39;s name MUST be &quot;data&quot;.</li>
<li>The property&#39;s value MUST be a string whose length is determined by the content after the subfield delimiter and code, and before the next MARC subfield delimiter or field terminator.</li>
<li>The property&#39;s value SHOULD contain the characters after the subfield delimiter and code, and before the next MARC subfield delimiter or field terminator.</li>
<li>The property&#39;s value MUST be specified in Unicode or escaped using JSON&#39;s character escape mechanisms.</li>
</ul>
</dd>
</dl>
</p><p><a name="Collections"></a>Collections<br />
<dl>
<dd>The MARC-JSON format contains four collections:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#record_Collection" title="">record collection</a> represents zero or more MARC records.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#controlfield_Collection" title="">controlfield collection</a> represents zero or more MARC control fields.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#datafield_Collection" title="">datafield collection</a> represents zero or more MARC data fields.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#subfield_Collection" title="">subfield collection</a> represents zero or more MARC subfields.</li>
</ul>
</dd>
</dl>
</p><p><a name="record_Collection"></a>record Collection<br />
<dl>
<dd>The record collection represents zero or more MARC records.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The collection MUST be a JSON array containing zero or more <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#record_Object" title="">record objects</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="controlfield_Collection"></a>controlfield Collection<br />
<dl>
<dd>The controlfield collection represents zero or more MARC control fields.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The collection MUST be a JSON array containing zero or more <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#controlfield_Object" title="">controlfield objects</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="datafield_Collection"></a>datafield Collection<br />
<dl>
<dd>The datafield collection represents zero or more MARC data fields</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The collection MUST be a JSON array containing zero or more <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#datafield_Object" title="">data field objects</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="subfield_Collection"></a>subfield Collection<br />
<dl>
<dd>The subfield collection represents zero or more MARC subfields.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The collection MUST be a JSON array containing zero or more <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#subfield_Object" title="">subfield objects</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="Serialization_Formats"></a>Serialization Formats<br />
<dl>
<dd>The MARC-JSON format has two serializations depending on the conforming implementation&#39;s use case scenario:
<ul>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#record_Serialization" title="">record serialization</a> represents a single MARC record.</li>
<li>The <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#collection_Serialization" title="">collection serialization</a> represents a collection of MARC records.</li>
</ul>
</dd>
</dl>
<dl>
<dd>Content encoding considerations:
<ul>
<li>The serialized JSON MUST be encoded in Unicode.</li>
<li>The serialized JSON SHOULD be encoded in Unicode NFC (normal form C).</li>
<li>The serialized JSON MUST be encoded in UTF-8, UTF-16 or UTF-32.</li>
<li>The serialized JSON MAY include a BOM (Byte Order Mark) when encoded in UTF-8.</li>
<li>The serialized JSON MUST include a BOM when encoded in UTF-16, UTF-16BE or UTF-16LE.</li>
<li>The serialized JSON MUST include a BOM when encoded in UTF-32, UTF-32BE or UTF-32LE.</li>
<li>The content-transfer-encoding for an HTTP response MUST be binary when JSON is encoded in UTF-16 or UTF-32.</li>
</ul>
</dd>
</dl>
<dl>
<dd>Media type and document extension considerations:
<ul>
<li>The media type for an HTTP request SHOULD be &quot;application/json&quot;.</li>
<li>The media type for an HTTP response MUST be &quot;application/json&quot;.</li>
<li>The document extension SHOULD be &quot;.json&quot;.</li>
</ul>
</dd>
</dl>
</p><p><a name="record_Serialization"></a>record Serialization<br />
<dl>
<dd>The record serialization allows a conforming implementation to serialize a single MARC record as a JSON object for data interchange.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The serialization MUST be a <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#record_Object" title="">record object</a>.</li>
</ul>
</dd>
</dl>
</p><p><a name="collection_Serialization"></a>collection Serialization<br />
<dl>
<dd>The collection serialization allows a conforming implementation to serialize zero or more MARC records as a JSON array for data interchange.</dd>
</dl>
<dl>
<dd>Constraints:
<ul>
<li>The serialization MUST be a <a href="http://worldcat.org/devnet/wiki/MARC-JSON_Draft_2010-03-11#record_Collection" title="">record collection</a>.</li>
<li>An conforming implementation SHOULD be cognizant of a consuming application&#39;s limitations and not serialize more data than a consuming application can handle.</li>
</ul>
</dd>
</dl>
</p><p><a name="References"></a>References<br />
<dl>
<dd>JSON format and standards
<ol>
<li><a class="external text" href="http://json.org/" rel="nofollow" title="http://json.org/">Introducing JSON</a> provides a description of the JSON format and available implementations.</li>
<li><a class="external<br />
text" href="http://tools.ietf.org/html/rfc4627" rel="nofollow" title="http://tools.ietf.org/html/rfc4627">RFC 4627</a> describes the JSON media type.</li>
<li><a class="external text" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" rel="nofollow" title="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA 262</a> contains the specification for the JSON subset of the ECMAScript programming language.</li>
</ol>
</dd>
</dl>
<dl>
<dd>MARC format and standards
<ol>
<li><a class="external text" href="http://www.loc.gov/marc/" rel="nofollow" title="http://www.loc.gov/marc/">MARC Standards</a> provides information about the various MARC formats and standards.</li>
<li><a class="external<br />
text" href="http://tools.ietf.org/html/rfc2220" rel="nofollow" title="http://tools.ietf.org/html/rfc2220">RFC 2220</a> describes the MARC media type.</li>
<li><a class="external text" href="http://www.loc.gov/marc/specifications/" rel="nofollow" title="http://www.loc.gov/marc/specifications/">MARC Record Structure</a> describes the MARC (ISO 2709) record structure, character sets, and exchange media.</li>
<li><a class="external<br />
 text" href="http://www.loc.gov/standards/marcxml/" rel="nofollow" title="http://www.loc.gov/standards/marcxml/">MARC XML Schema</a> provides information on serializing MARC (ISO 2709) into XML using an XML schema.</li>
<li><a class="external text" href="http://www.loc.gov/standards/iso25577/ISO_DIS_25577__E_.pdf" rel="nofollow" title="http://www.loc.gov/standards/iso25577/ISO_DIS_25577__E_.pdf">MarcXchange</a>, also known as ISO 25577, provides information on serializing MARC (ISO 2709) into XML using an XML schema.</li>
<li><a class="external text" href="http://tools.ietf.org/html/draft-denenberg-mods-etc-media-types-00" rel="nofollow" title="http://tools.ietf.org/html/draft-denenberg-mods-etc-media-types-00">IETF Draft</a> describes various media types for library formats including MARC-XML.</li>
</ol>
</dd>
</dl>
<dl>
<dd>ISO standards
<ol>
<li><a class="external text" href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=41319" rel="nofollow" title="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=41319">ISO 2709</a> provides an abstract of the standard and purchasing options.</li>
<li><a class="external text" href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=43005" rel="nofollow" title="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=43005">ISO 25577</a> provides an abstract of the standard and purchasing options.</li>
</ol>
</dd>
</dl>
</p><p><a name="Appendix_A_.28Informative.29"></a>Appendix A (Informative)<br />
<dl>
<dd>An XSLT 2.0 <a class="internal" href="http://worldcat.org/devnet-real/images/4/48/MARC-JSON_Draft_2010-03-11.txt" title="MARC-JSON Draft 2010-03-11.txt">transform</a> is being provided to demonstrate a conforming implementation of this specification. The XSLT 2.0 transform described in this appendix is informative rather than normative. The transform converts MARC (ISO 2709) that has been serialized as MARC-XML or MarcXchange (ISO 25577) XML into MARC-JSON. The input XML document to the transform may be either a single MARC record or a collection of MARC records.</dd>
</dl>
</p>  </div>
  
  <div class="groups">Groups: <div class="links"><ul class="links"><li class="og_29 first last"><a href="/developer/groups/marc-json-format-specification"> MARC-JSON Format Specification </a></li>
</ul></div></div>
  <ul class="links inline"><li class="comment_forbidden first last"><span><a href="/developer/user/login?destination=comment%2Freply%2F30%23comment-form">Login</a> or <a href="/developer/user/register?destination=comment%2Freply%2F30%23comment-form">register</a> to post comments</span></li>
</ul></div>  <div id="comments">
          <h2 id="comments-title">Comments</h2>
        <a id="comment-2943"></a>
<div class="comment comment-published odd first comment-by-anon"><div class="comment-inner clear-block">

      <h3 class="title">
      <a href="/developer/content/marc-json-draft-2010-03-11#comment-2943" class="active">Example doesn&#039;t validate</a>          </h3>
  
  
  
  <div class="submitted">
    Submitted by Anonymous on Tue, 05/01/2012 - 10:12pm.  </div>

  <div class="content">
    <p>Accordingly to jsonlint.com, the example provided in this page doesn&#39;t validate. Propoerties must be enclosed in double quotes.</p>      </div>

      <div class="links">
      <ul class="links"><li class="comment_forbidden first last"><span><a href="/developer/user/login?destination=comment%2Freply%2F30%23comment-form">Login</a> or <a href="/developer/user/register?destination=comment%2Freply%2F30%23comment-form">register</a> to post comments</span></li>
</ul>    </div>
  
</div></div> <!-- /comment-inner, /comment -->
<a id="comment-264"></a>
<div class="comment comment-published even last comment-by-anon"><div class="comment-inner clear-block">

      <h3 class="title">
      <a href="/developer/content/marc-json-draft-2010-03-11#comment-264" class="active">BOM and RFC:4627</a>          </h3>
  
  
  
  <div class="submitted">
    Submitted by Anonymous on Mon, 02/07/2011 - 10:36am.  </div>

  <div class="content">
    <p>The use of BOMs for payload advertised as `application/json` is in contradiction to RFC 4627&#39;s utf-encoding detection defined in chapter 3</p>      </div>

      <div class="links">
      <ul class="links"><li class="comment_forbidden first last"><span><a href="/developer/user/login?destination=comment%2Freply%2F30%23comment-form">Login</a> or <a href="/developer/user/register?destination=comment%2Freply%2F30%23comment-form">register</a> to post comments</span></li>
</ul>    </div>
  
</div></div> <!-- /comment-inner, /comment -->
  </div>
				</div>
			</div>
		</div>
	</div>
	
		<div id="ft">
				
		  <div id="block-block-4" class="block block-block region-odd odd region-count-1 count-5"><div class="block-inner">

  
  <div class="content">
    
<ul id="ft-nav">
<li><a href="/developer/about" title="about">About OCLC Developer Network</a></li>
<li><a href="/developer/contact" title="Contact Us">Contact Us</a></li>
<li><a href="http://www.oclc.org/us/en/policies/privacy/default.htm" title="Privacy Policy">Privacy Policy</a></li>
</ul>

<div id="socialize">
<p>Follow the OCLC Developer Network:</p>
<ul>
<li><a class="flickr" href="http://www.flickr.com/search/?q=oclc+mashathon" title="See Developer Network photos on Flickr">Flickr</a></li>
<li><a class="twitter" href="http://twitter.com/oclcdevnet" title="Follow us on Twitter">Twitter</a></li>
<li><a class="youtube" href="http://www.youtube.com/results?search_query=oclc+mashathon" title="See Developer Network Videos on YouTube">YouTube</a></li>
<li><a class="email" href="mailto:devnet@oclc.org" title="">Email</a></li>
</ul>
</div>

<p>The OCLC Developer Network supports the use of OCLC Web Services&mdash;a set of tools and APIs that expose data and services for WorldCat and our member libraries and partner institutions or companies. <a href="/developer/services" title="learn more about OCLC Web services">learn more &raquo;</a></p>

<p><a href="http://www.oclc.org/policies/copyright/default.htm" title="">&copy; 2010 OCLC</a> Domestic and international trademarks and/or service marks of OCLC Online Computer Library Center, Inc. and its affiliates
</p>
<br clear="all"/>
<div style="text-align:center;">
<a href="http://drupal.org"><img src="/developer//misc/powered-blue-80x15.png" alt="Powered by Drupal, an open source content management system" title="Powered by Drupal, an open source content management system" width="80" height="15" /></a>
</div>  </div>

  
</div></div> <!-- /block-inner, /block -->
	</div>
		</div>	
<!--  SiteCatalyst footer put this at/near the end of your <body> section --><!-- 423  SiteCatalyst code version: H.14.        Copyright 1997-2009 Omniture, Inc. More info available at http://www.omniture.com --><script language="JavaScript"><!--        s.pageName="MARC-JSON Draft 2010-03-11 (/developer/content/marc-json-draft-2010-03-11)"        s.channel="Developer Network"
                s.prop9=""        s.prop21="/developer/content/marc-json-draft-2010-03-11"        s.prop22="MARC-JSON Draft 2010-03-11"        s.prop23="30"        /***** THIS VAR MUST FOLLOW ALL OTHER SITE ANALYTIC VARIABLES - DO NOT MOVE OR ALTER! **************/var s_code=s.t();if(s_code)document.write(s_code)//--></script><!-- / SiteCatalyst code version: H.14. -->
</body>
</html>
